package cn.itsource.base.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data  /*lombok 自动提供getset方法toString*/
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Boolean success=true;//封装是否成功
    private String msg="操作成功";//封装操作消息
    private Object resultObj;

    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult setMsg(String msg){//失败的
        this.success=false;
        this.msg = msg;
        return this;
    }

    public AjaxResult setResultObj(Object obj){
        this.resultObj = obj;
        return this;
    }


}
